package cn.xbtop.blog.service.impl;

import cn.xbtop.blog.mapper.UserMapper;
import cn.xbtop.blog.pojo.User;
import cn.xbtop.blog.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author  Mxb
 * @date  2020/2/19 15:48
 * @version 1.0
 */
@Service
public class UserServiceImpl implements UserService{

    @Resource
    private UserMapper userMapper;

    @Override
    public int deleteByPrimaryKey(Integer userId) {
        return userMapper.deleteByPrimaryKey(userId);
    }

    @Override
    public int insert(User user) {
        return userMapper.insert(user);
    }

    @Override
    public User selectByPrimaryKey(Integer userId) {
        return userMapper.selectByPrimaryKey(userId);
    }

    @Override
    public int updateByPrimaryKey(User user) {
        return userMapper.updateByPrimaryKey(user);
    }

    /**
     * 查询所有用户
     * @param user
     * @return
     */
    @Override
    public List<User> findAllUser(User user) {
        return userMapper.findAllUser(user);
    }
}
